Skip to content

Support MassedCompute network volumes - #4553

Draft
peterschmidt85 wants to merge 8 commits into
masterfrom
pr_massedcompute_volumes
Draft

peterschmidt85 wants to merge 8 commits into
masterfrom
pr_massedcompute_volumes

Conversation

@peterschmidt85

@peterschmidt85 peterschmidt85 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds experimental type: volume support to the MassedCompute VM backend (#4533). Users can create Persistent Storage or register an existing volume by UUID.

Warning

MassedCompute can report a successful sync after an upload fails. For example, a VM may lose its connection to storage while a job overwrites or deletes a file. If dstack receives success and terminates the VM before the change reaches storage, the next VM can read the old contents or see the deleted file reappear. We’ve reported this to MassedCompute. Storage documentation · GeeseFS directory sync

MassedCompute backend

  • Passes up to eight volume UUIDs at VM launch and verifies that each volume is attached to the expected VM at the expected path. Use each volume on one VM at a time.
  • The volume pipeline records PROVISIONING before creating managed MassedCompute storage. Retries look up the original volume by name. A crash before sending the request can leave it pending. Timed auto-cleanup is disabled because a second registration can reference the same storage ([Bug]: Volume auto-cleanup marks a managed volume for deletion while it is in use under another name #4537).
  • If the VM launch reply is lost, the backend looks up the original VM by name. Orphan cleanup retains VMs with volumes for manual removal because it cannot flush them.

Core changes

  • Scheduling. The backend reports which volumes are mounted on the VM. The scheduler reuses an instance only if it has the job’s requested provider-mounted volumes. Attachments stay with the VM across jobs.
  • Shim. Before jobs start, the shim records the guest boot ID and Linux mount IDs. It verifies the same filesystem before binding it into a job container or flushing it. VMs that require a flush use a private Unix socket over SSH so host networking alone cannot trigger shutdown.
  • Termination. The shim stops its managed containers, flushes in the background, and saves completion on the VM. The server polls in TERMINATING and can recover after a lost reply or restart. On a reported error it keeps the VM and retries. Compute billing continues. Attachments are released once the provider confirms the VM is gone.
  • Instance pipeline. Each replica handles up to four mount checks or terminations for VMs with provider-mounted volumes in a separate executor, under the existing database lock token. A slow flush leaves the shared instance workers available to provision other fleets. Instance pipeline

Upgrade the CLI and all server replicas before first use. An older replica can delete the VM without flushing its volumes.

@peterschmidt85
peterschmidt85 force-pushed the pr_massedcompute_volumes branch 4 times, most recently from 9ba585f to eeb0a22 Compare November 27, 2026 14:44
@peterschmidt85
peterschmidt85 force-pushed the pr_massedcompute_volumes branch from eeb0a22 to 9ea1266 Compare December 1, 2026 09:57
Andrey Cheptsov added 7 commits December 1, 2026 14:13
Run the terminal flush on the instance, fence dstack writers, and record its result before acknowledging completion. Bound mounted-instance readiness and termination calls separately from shared provisioning while keeping the original database lease.
Record stable mount identities before publishing the hostname, and compare them on the same file descriptor that binds or flushes a volume. Restrict the opted-in shim to the management account's Unix socket over SSH.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant